import Search from "@/pages/home/components/search/search.vue";
import Goods from "@/pages/home/components/goods/goods.vue";
import Classfiy from "@/pages/home/components/classfiy/classfiy.vue";
import Recommend from "@/pages/home/components/recommend/recommend.vue";
import Banner from "@/components/banner/banner.vue";
import Swiper from "@/pages/home/components/swiper/swiper.vue";

export default {
  name: "Home",
  components: {
    Search,
    Goods,
    Classfiy,
    Recommend,
    Banner,
    Swiper,
  },

  data: () => {
    return {
      trees: [
        {
          label: "一级 1",
          children: [
            {
              label: "二级 1-1",
              children: [
                {
                  label: "三级 1-1-1",
                },
              ],
            },
          ],
        },
        {
          label: "一级 2",
          children: [
            {
              label: "二级 2-1",
              children: [
                {
                  label: "三级 2-1-1",
                },
              ],
            },
            {
              label: "二级 2-2",
              children: [
                {
                  label: "三级 2-2-1",
                },
              ],
            },
          ],
        },
        {
          label: "一级 3",
          children: [
            {
              label: "二级 3-1",
              children: [
                {
                  label: "三级 3-1-1",
                },
              ],
            },
            {
              label: "二级 3-2",
              children: [
                {
                  label: "三级 3-2-1",
                },
              ],
            },
          ],
        },
      ],
      defaultProps: {
        children: "children",
        label: "label",
      },
      isShow: true,
      topUrl: "../../assets/esale_head_top_adver.png",
    };
  },
  methods: {
    runStore() {},
  },
  updated() {
    this.runStore();
  },
  mounted() {
    const that = this;
    this.$store.dispatch("getCount", () => {
      console.log(that.$store.state.home.result, "xxx");
      that.result = that.$store.state.home.result;
    });
  },
};
